package com.yohann.eduservice.controller;

import org.springframework.web.bind.annotation.*;

import com.yohann.commonutils.result.R;

/**
 * <p>
 * 登录前端控制器
 * </p>
 *
 * @author Yohann
 * @since 2020/8/6
 */
@RestController
@RequestMapping("/edu-service/user")
public class LoginController {
    /**
     * 登录验证
     * @return
     */
    @PostMapping("login")
    public R login() {
        return R.ok().data("token", "admin");
    }

    /**
     * 登录成功
     * @return
     */
    @GetMapping("info")
    public R info() {
        return R.ok().data("roles", "上帝").data("name", "Yohann").data("avatar", "https://rice-college.oss-cn-shenzhen.aliyuncs.com/2020/08/07/12f76d97de7445098480d4ee7b5512bafile.png");
    }

    @GetMapping("logout")
    public R logout() {
        return R.ok();
    }
}